package com.example.rocketdemo.consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @author GuoAo
 * @className LogKeyConsumer
 * @date 2025/7/16
 * @description TODO  consumeMode = ConsumeMode.ORDERLY 实现消息的失败重试
 */
@Component
@Slf4j
@RocketMQMessageListener(topic = "log-topic",consumerGroup = "consumer",selectorExpression = "plus",consumeMode = ConsumeMode.ORDERLY)
public class LogKeyConsumer implements RocketMQListener<String> {
    @Override
    public void onMessage(String s) {
        log.info("接收到的消息：{}",s);
    }
}
